﻿using System.Text;
using Styx.Helpers;
using System.IO;
using Styx;
using Styx.Common;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.TreeSharp;

namespace Guardian
{
    public class SettingsCommon : Settings
    {
        public static readonly SettingsCommon myPrefs = new SettingsCommon();

        public SettingsCommon()
            : base(
                Path.Combine(Utilities.AssemblyDirectory,
                    string.Format(@"Routines/Settings/{0}/Druid/SettingsBoth-{1}.xml", StyxWoW.Me.RealmName, StyxWoW.Me.Name))
                )
        {
        }
        public enum Keypress
        {
            NONE,
            LSHIFT,
            RSHIFT,
            LCTRL,
            RCTRL,
            LALT,
            RALT
        };

        [Setting]
        [DefaultValue(Keypress.NONE)]
        [Category("Hotkeys")]
        [DisplayName("Pause Aoe Key")]
        [Description("Pause Aoe Key")]
        public Keypress StopAoeKey { get; set; }

        [Setting]
        [DefaultValue(Keypress.NONE)]
        [Category("Hotkeys")]
        [DisplayName("Pause CR Key")]
        [Description("Pause Combat Routine Key")]
        public Keypress StopCRKey { get; set; }

        [Setting]
        [DefaultValue(Keypress.NONE)]
        [Category("Hotkeys")]
        [DisplayName("Bear Form Key")]
        [Description("Key to switch to Bear Form")]
        public Keypress BearFormKeys { get; set; }


        [Setting]
        [DefaultValue(true)]
        [Category("Hotkeys")]
        [DisplayName("Print Raidstyle Messages")]
        public bool PrintRaidstyleMsg { get; set; }

        //movement

        [Setting]
        [DefaultValue(true)]
        [Category("Movement")]
        [DisplayName("Auto Target")]
        [Description("Auto Target")]
        public bool AutoTargeting { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("Movement")]
        [DisplayName("Movement")]
        [Description("Movement")]
        public bool AutoMovement { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("Movement")]
        [DisplayName("Auto Facing")]
        [Description("Auto Facing")]
        public bool AutoFacing { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Movement in Raids, Instances, Dungeons")]
        [DisplayName("Disable Auto Move")]
        [Description("Disable Auto Movement in Raids, Instances, Dungeons")]
        public bool AutoMovementRaid { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Movement in Raids, Instances, Dungeons")]
        [DisplayName("Disable Auto Target")]
        [Description("Disable Auto Targeting in Raids, Instances, Dungeons")]
        public bool AutoTargetingRaid { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Movement in Raids, Instances, Dungeons")]
        [DisplayName("Disable Auto Facing")]
        [Description("Disable Auto Facing in Raids, Instances, Dungeons")]
        public bool AutoFacingRaid { get; set; }

        //resting
        [Setting]
        [DefaultValue(85)]
        [Category("Resting")]
        [DisplayName("Rejuvenation HP %")]
        [Description("Use Rejuvenation below HP % Out of Combat")]
        public int PercentRejuvenation { get; set; }

        [Setting]
        [DefaultValue(70)]
        [Category("Resting")]
        [DisplayName("Healing HP %")]
        [Description("Use Healing Touch below HP % Out of Combat")]
        public int PercentHealingTouch { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Resting")]
        [DisplayName("Eat Food HP %")]
        [Description("Eat Food below HP % Out of Combat")]
        public int PercentEatFood { get; set; }

        //flasks
        public enum FlaskUse
        {
            Manual,
            Raids,
            Raids_but_not_LFR,
            Dungeons
        }
        [Setting]
        [DefaultValue(false)]
        [Category("Flasks & Potions")]
        [DisplayName("Alchemy Flask")]
        [Description("Auto use Alchemy Flask when no more powerfull buff exists")]
        public bool AutoUseAlchemyFlask { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Flasks & Potions")]
        [DisplayName("Crystal of Insanity")]
        [Description("Auto use Crystal of Insanity when no FlaskBuff exists")]
        public bool AutoUseCrystalOfInsanity { get; set; }

        [Setting]
        [DefaultValue(FlaskUse.Manual)]
        [Category("Flasks & Potions")]
        [DisplayName("Flask of the Earth")]
        [Description("Auto use Flask of the Earth")]
        public FlaskUse AutoUseFlaskOfTheEarth { get; set; }

        [Setting]
        [DefaultValue(FlaskUse.Manual)]
        [Category("Flasks & Potions")]
        [DisplayName("Flask of Spring Blossom")]
        [Description("Auto use Flask of Spring Blossom")]
        public FlaskUse AutoUseFlaskOfSpringBlossom { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Timeless Isle")]
        [DisplayName("Auto Buffs")]
        [Description("Auto Buff Timeless Isle Buffs")]
        public bool AutoTimelessIsleBuffs { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Protection")]
        [DisplayName("Rejuvenation in combat HP %")]
        [Description("Cast Rejuvenation in combat below HP %")]
        public int PercentRejuCombat { get; set; }
    }
}
